
export const useUserStore = defineStore('user', () => {
    const posts = ref([])
    const isMenuOverlay = ref(false)
    const isLogoutOverlay = ref(false)

    const getAllPosts = async () => {
        const res = await useFetch('/api/get-all-posts')
        posts.value = res.data.value
        return res.data.value
    }


    return {
        posts,
        isMenuOverlay,
        isLogoutOverlay,
        getAllPosts
    }
})